<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.1">
  <link rel="apple-touch-icon" sizes="180x180" href="/blog/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/blog/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/blog/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/blog/images/logo.svg" color="#222">

<link rel="stylesheet" href="/blog/css/main.css">


<link rel="stylesheet" href="/blog/lib/font-awesome/css/all.min.css">
  <link rel="stylesheet" href="/blog/lib/pace/pace-theme-material.min.css">
  <script src="/blog/lib/pace/pace.min.js"></script>

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"gitee.com","root":"/blog/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
  </script>

  <meta name="description" content="最近在我的网站中做了个Java在线运行的小工具（点我直达），可以运行一些较为简单的Java程序，在没有电脑或者电脑上没有安装Java环境的时候可以应急使用。前端使用Javascript所写的开源Ace Editor在线代码编辑器（Github），后端使用Javaweb。具体的使用方法如下：">
<meta property="og:type" content="article">
<meta property="og:title" content="Java在线工具使用教程">
<meta property="og:url" content="https://gitee.com/chinazhouqian/blog.git/2020/05/22/Java%E5%9C%A8%E7%BA%BF%E5%B7%A5%E5%85%B7%E4%BD%BF%E7%94%A8%E6%95%99%E7%A8%8B/index.html">
<meta property="og:site_name" content="我的个人博客">
<meta property="og:description" content="最近在我的网站中做了个Java在线运行的小工具（点我直达），可以运行一些较为简单的Java程序，在没有电脑或者电脑上没有安装Java环境的时候可以应急使用。前端使用Javascript所写的开源Ace Editor在线代码编辑器（Github），后端使用Javaweb。具体的使用方法如下：">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://pic.downk.cc/item/5ec7d5c2c2a9a83be520fada.png">
<meta property="og:image" content="https://pic.downk.cc/item/5ec7d5c2c2a9a83be520fae0.png">
<meta property="og:image" content="https://pic.downk.cc/item/5ec7d8b9c2a9a83be527e79e.png">
<meta property="article:published_time" content="2020-05-22T11:35:00.000Z">
<meta property="article:modified_time" content="2020-06-05T11:30:21.905Z">
<meta property="article:author" content="周迁">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://pic.downk.cc/item/5ec7d5c2c2a9a83be520fada.png">

<link rel="canonical" href="https://gitee.com/chinazhouqian/blog.git/2020/05/22/Java%E5%9C%A8%E7%BA%BF%E5%B7%A5%E5%85%B7%E4%BD%BF%E7%94%A8%E6%95%99%E7%A8%8B/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>Java在线工具使用教程 | 我的个人博客</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/blog/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">我的个人博客</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/blog/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/blog/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/blog/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
  </ul>
</nav>




</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://gitee.com/chinazhouqian/blog.git/2020/05/22/Java%E5%9C%A8%E7%BA%BF%E5%B7%A5%E5%85%B7%E4%BD%BF%E7%94%A8%E6%95%99%E7%A8%8B/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="https://pic.downk.cc/item/5ec7be4ec2a9a83be5ee74ed.jpg">
      <meta itemprop="name" content="周迁">
      <meta itemprop="description" content="欢迎您的到来">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="我的个人博客">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          Java在线工具使用教程
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2020-05-22 19:35:00" itemprop="dateCreated datePublished" datetime="2020-05-22T19:35:00+08:00">2020-05-22</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2020-06-05 19:30:21" itemprop="dateModified" datetime="2020-06-05T19:30:21+08:00">2020-06-05</time>
              </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <p>最近在我的网站中做了个Java在线运行的小工具（<a href="https://zq.yixuedh.com/comilper/app.jsp" target="_blank" rel="noopener">点我直达</a>），可以运行一些较为简单的Java程序，在没有电脑或者电脑上没有安装Java环境的时候可以应急使用。前端使用Javascript所写的开源Ace Editor在线代码编辑器（<a href="https://github.com/ajaxorg/ace" target="_blank" rel="noopener">Github</a>），后端使用Javaweb。具体的使用方法如下：</p>
<h3 id="打开网站"><a href="#打开网站" class="headerlink" title="打开网站"></a><a id="more"></a>打开网站</h3><p>点击 <a href="https://zqno.top" target="_blank" rel="noopener">我的个人网站</a> 进入这个页面（网页可能有变动但大致相同）：</p>
<p><img src="https://pic.downk.cc/item/5ec7d5c2c2a9a83be520fada.png" alt="avatar"><br>点击开始编写按钮/右上角”开始编写” 即可开始编写你的Java代码</p>
<h3 id="编写代码"><a href="#编写代码" class="headerlink" title="编写代码"></a>编写代码</h3><p>跳转这个页面后：</p>
<p><img src="https://pic.downk.cc/item/5ec7d5c2c2a9a83be520fae0.png" alt="avatar"></p>
<p>中间的空白部分可以敲入代码，下方提供了一个例子：</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">HelloWorld</span> </span>&#123;</span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">main</span><span class="params">(String[] args)</span> </span>&#123;</span><br><span class="line">        System.out.println(<span class="string">"Hello World"</span>);</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>请不要在此处写package，编译会不通过，并且，由于目前此工具不支持多文件项目，请尽可能的将你的class写到此处</p>
<h3 id="编译运行"><a href="#编译运行" class="headerlink" title="编译运行"></a>编译运行</h3><h5 id="PC端："><a href="#PC端：" class="headerlink" title="PC端："></a>PC端：</h5><p>如果你正在使用PC（装有Windows、macOS、Linux等）具有键盘的设备，那么，你将可以在浏览器中使用Ctrl+S弹出运行对话框，除此之外，内建的搜索功能也能通过Ctrl+F打开</p>
<p><img src="https://pic.downk.cc/item/5ec7d8b9c2a9a83be527e79e.png" alt="avatar"></p>
<p>在此处你可以设置程序所需要接受的输入，如果有多个输入，可以使用空格隔开或者每行一个参数<br>下方的三个按钮分别是：运行程序、减少运行时间和增加运行时间</p>
<h6 id="运行程序："><a href="#运行程序：" class="headerlink" title="运行程序："></a>运行程序：</h6><p>点击该按钮后，程序将会发送到服务器上由后端处理，并返回输出结果，如果代码存在错误，也会在弹出的窗口中输出错误信息</p>
<h6 id="减少运行时间"><a href="#减少运行时间" class="headerlink" title="减少运行时间:"></a>减少运行时间:</h6><p>由于服务器资源有限，我设置了每个程序默认在后端只能执行两秒，避免死循环或其他情况导致服务器崩溃，如果你觉得你的程序不需要执行那么长的时间，那么可以点击减少运行时间来降低服务器的负担</p>
<h6 id="增加运行时间"><a href="#增加运行时间" class="headerlink" title="增加运行时间:"></a>增加运行时间:</h6><p>如果你觉得你的程序需要更长的执行时间才能获得正确的输出，那么可以点击增加运行时间让你的程序运行更长的时间</p>
<h5 id="移动设备："><a href="#移动设备：" class="headerlink" title="移动设备："></a>移动设备：</h5><p>如果你是用的是手机、平板等这类不具有键盘的设备，在写好代码之后，请点击右下角的编译运行按钮打开运行对话框，之后的操作请参见PC端</p>
<p>最后，希望大家能喜欢这个工具</p>

    </div>

    
    
    

      <footer class="post-footer">

        


        
    <div class="post-nav">
      <div class="post-nav-item"></div>
      <div class="post-nav-item">
    <a href="/blog/2020/05/31/Chrome%E6%B2%B9%E7%8C%B4%E6%8F%92%E4%BB%B6%E4%BD%BF%E7%94%A8%E6%95%99%E7%A8%8B/" rel="next" title="Chrome油猴插件使用教程">
      Chrome油猴插件使用教程 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#打开网站"><span class="nav-number">1.</span> <span class="nav-text">打开网站</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#编写代码"><span class="nav-number">2.</span> <span class="nav-text">编写代码</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#编译运行"><span class="nav-number">3.</span> <span class="nav-text">编译运行</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#PC端："><span class="nav-number">3.0.1.</span> <span class="nav-text">PC端：</span></a><ol class="nav-child"><li class="nav-item nav-level-6"><a class="nav-link" href="#运行程序："><span class="nav-number">3.0.1.1.</span> <span class="nav-text">运行程序：</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#减少运行时间"><span class="nav-number">3.0.1.2.</span> <span class="nav-text">减少运行时间:</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#增加运行时间"><span class="nav-number">3.0.1.3.</span> <span class="nav-text">增加运行时间:</span></a></li></ol></li><li class="nav-item nav-level-5"><a class="nav-link" href="#移动设备："><span class="nav-number">3.0.2.</span> <span class="nav-text">移动设备：</span></a></li></ol></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="周迁"
      src="https://pic.downk.cc/item/5ec7be4ec2a9a83be5ee74ed.jpg">
  <p class="site-author-name" itemprop="name">周迁</p>
  <div class="site-description" itemprop="description">欢迎您的到来</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/blog/archives/">
        
          <span class="site-state-item-count">3</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">周迁</span>
</div>

<!--
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> 强力驱动
  </div>
-->

        








      </div>
    </footer>
  </div>

  
  <script src="/blog/lib/anime.min.js"></script>
  <script src="/blog/lib/velocity/velocity.min.js"></script>
  <script src="/blog/lib/velocity/velocity.ui.min.js"></script>

<script src="/blog/js/utils.js"></script>

<script src="/blog/js/motion.js"></script>


<script src="/blog/js/schemes/pisces.js"></script>


<script src="/blog/js/next-boot.js"></script>




  















  

  

</body>
<!-- 页面点击小红心 -->
<script type="text/javascript" src="/blog/js/src/clicklove.js"></script>
<!-- 交互式粒子特效 -->
<script type="text/javascript" src="https://cdn.bootcss.com/canvas-nest.js/1.0.1/canvas-nest.js"></script>
</html>
